<script setup lang="ts">
import Header from '@/components/Header.vue'
import { RouterLink, RouterView } from 'vue-router'  
</script>

<template>
  <Header></Header>
  <div class="middle">
    <!-- 导航区 -->
    <div class="navigate">
      <RouterLink to="/prop" active-class="active" class="tab">1.props</RouterLink>
      <RouterLink to="/func" active-class="active" class="tab">2.自定义事件</RouterLink>
      <RouterLink to="/mitt" active-class="active" class="tab">3.mitt</RouterLink>
      <RouterLink to="/model" active-class="active" class="tab">4.v-model</RouterLink>
      <RouterLink to="/attrs" active-class="active" class="tab">5.$attrs</RouterLink>
      <RouterLink to="/r" active-class="active" class="tab">6.$refs、$parent</RouterLink>
      <RouterLink to="/p" active-class="active" class="tab">7.provide、inject</RouterLink>
      <RouterLink to="/pinia" active-class="active" class="tab">8.pinia</RouterLink>
      <RouterLink to="/slot" active-class="active" class="tab">9.slot</RouterLink>

    </div>
    <!-- 展示区 -->
    <div class="content">
      <RouterView></RouterView>
    </div>
  </div>
</template>

<style scoped>
.middle{
  width: 98%;
  display: flex;
  margin-top: 50px;
}
.navigate {
  width: 300px;
  height: 120px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
}

.active {
  background-color: #fcd3d3;
}

.tab {
  width: 350px;
  height: 60px;
  line-height: 60px;

  text-decoration: none;
  text-align: center;

  border: 1px solid rgb(192, 192, 192);
}

.active {
  color: rgb(84, 84, 255);
background-color: white;
}

.content {
  width:1200px;
  min-height: 450px;
  margin: 0 auto;
  border-radius: 10px;
  margin: 0 auto;
}
</style>
